#include <stdio.h>

//https://www.nowcoder.com/practice/5e85cc26475449648e668aa98e92d05b?tpId=290&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D290

int main() {
    int num = 0;
    int sum = 0;
    while (scanf("%1d", &num) != EOF) {
        sum += num;
    }
    printf("%d", sum);
    return 0;
}

